<?php
// the set of includes used on each web page
include_once "xAP-functions/functions.php";
include_once "xAP-config/config.php";
include_once "xAP-functions/database.php";
include_once "xAP-functions/xAP.php";
include_once "xAP-functions/event.php";

// specifc loads per module
//first get the mdulename from the url
$url=explode("/",strtolower($_SERVER['REQUEST_URI']));
$config["modulefolder"]=preg_replace("[^a-z]","",$url[1]);
if (file_exists($config["basefolder"]."engine/".$config["modulefolder"]."/config.php")){
	include_once $config["basefolder"]."engine/".$config["modulefolder"]."/config.php";
}

if (file_exists($config["basefolder"]."htdocs/".$config["modulefolder"]."/functions.php")){
	include_once $config["basefolder"]."htdocs/".$config["modulefolder"]."/functions.php";
}

// weblayout
include_once $config["basefolder"]."htdocs/xAP-layout/".$config["theme"]."/layout.php";
?>